package com.ruoyi.controller;

import com.ruoyi.entity.Classes;
import com.ruoyi.service.EsService;
import com.ruoyi.utils.Result;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/es")
public class EsController {

    @Resource
    private EsService esService;

    @RequestMapping("/essave")
    public Result essave() throws Exception {

        return esService.save();
    }

    @RequestMapping("/esList")
    public Result esList(@RequestBody Classes classes){

        return esService.list(classes);
    }

    @RequestMapping("/udpateStatus")
    public Result updateStatus(@RequestParam("id") Integer id, @RequestParam("status") Integer status){


        return esService.updateStatus(id,status);
    }


    public static void main(String[] args) {
        String a="1,2,3";
        String[] b=a.split("\\ .");
        System.out.println(b[0]);
    }
}
